import myaxios from "../myaxios/myaxios"
/* 用户注册量 */
export const getUserCount = (date) => myaxios.get("/statis/user/" + date + "/count");
/* 所有用户注册量 */
export const getAllUserCount = (date) => myaxios.get("/v1/users/count");
/* 某天的订单数量 */
export const getOrderCount = (date) => myaxios.get("/statis/order/" + date + "/count");
/* 获取所有的订单数量 */
export const getAllOrderCount = () => myaxios.get("/bos/orders/count");
/* 新增注册的管理员 */
export const getAdminCount = (date) => myaxios.get("/statis/admin/" + date + "/count");
/* 获取管理员数量 */
export const getAllAdminCount = () => myaxios.get("/admin/count");
/* 获取用户列表 */
export const getUserList = (data)=> myaxios.get("/v1/users/list",{
    params:data
})
/* 获取管理员列表 */
export const getAdminList = (data)=> myaxios.get("/admin/all",{
    params:data
})
/* 获取订单列表 */
export const getOrderList = (data)=> myaxios.get("/bos/orders",{
    params:data
})
/* 获取食品列表 */
export const getFoodList = (data) => myaxios.get("/shopping/v2/foods",{
    params:data
})
/* 获取餐馆列表 */
export const getRestaurantsList = (data) => myaxios.get("/shopping/restaurants", {
  params: {
    latitude: 0,
    longitude: 0,
    ...data,
  },
});
/* 获取餐馆总数 */
export const  getAllRestaurantCount = (data) => myaxios.get("/shopping/restaurants/count")
/**
 * 更新食品信息
 */

export const updateFood = (data) => myaxios.post("/shopping/v2/updatefood", data);
/* 删除食品 */
export const deleteFood = (food_id) => myaxios.delete("/shopping/v2/food/" + food_id);
// getMenu, updateFood, deleteFood, getResturantDetail, getMenuById

/**
 * 获取餐馆详细信息
 */

export const getResturantDetail = (restaurant_id) =>
  myaxios.get("/shopping/restaurant/" + restaurant_id);

  /**
 * 获取menu详情
 */

export const getMenuById = (category_id) =>
myaxios.get("/shopping/v2/menu/" + category_id);


  /* 获取管理员信息 */
export const getAdminInfo = () => myaxios.get("/admin/info");

/* 获取食品列表 */
export const getMenu = (data) =>
  myaxios.get("/shopping/v2/menu", {
    params: data,
  });
/* 搜索地点 */
export const searchPlace = (data) => myaxios.get("/v1/pois", { params: {...data,city_id: 11,type: "search",}});
/* 食品分类 */
export const foodCategory = (latitude, longitude) => myaxios.get("/shopping/v2/restaurant/category");

/* 更新餐馆 */
export const updateShop = (data) => myaxios.post("/shopping/updateshop", data);